# -*- coding: utf-8 -*-
'''
    :file: config.py
    :author: -Farmer
    :url: https://blog.farmer233.top
    :date: 2021/04/27 19:49:16
'''
import os

BASE_DIR = os.path.dirname(os.path.abspath(__name__))
dotenv_path = os.path.join(BASE_DIR, '.env')


# 加载环境变量
try:
    from dotenv import load_dotenv
    if os.path.exists(dotenv_path):
        data = load_dotenv(dotenv_path)
except Exception as e:
    print(e)

HOST = os.getenv('HOST', '127.0.0.1')
PORT = int(os.getenv('PORT', 8000))

BUFFER_SIZE = int(os.getenv('BUFFER_SIZE', 1024))
INDEX_FILE = os.getenv('INDEX_FILE', 'index.html')

STATIC_FOLDER = os.getenv('STATIC_FOLDER', 'static')

WEB_SITE_FOLDER = os.path.join(BASE_DIR, STATIC_FOLDER)

print(STATIC_FOLDER)